﻿package src.computation.distributionLaw 
{
	
	/**
	* 
	* Reliability project
	* -----------------------
	* @author  Dmitrij Boycov
	* @mail    dmitry.boycov@gmail.com
	* @date    April 27, 2010
	* @version 1
	* 
	*/
	
	import com.yahoo.astra.containers.formClasses.FormItem;	
	import com.yahoo.astra.layout.LayoutContainer;
	import com.yahoo.astra.layout.modes.BoxLayout;
	
	public class AbstractLaw extends LayoutContainer{
		
		protected var time;
		public var desc = "Abstract.Probability equal 1";
		public static var TYPE = "abstract";
		
		public function AbstractLaw() {
			var box : BoxLayout = new BoxLayout();
			box.direction = "vertical";
			box.verticalGap = 10;			
			super(box);		
		}
		
		public function getProbabilty(time=null) {
			return 1;
		}
		
		/**
		 * random
		 * The function returns a random number that obeys a given distribution law.
		 * @return numder
		 */
		public function random():Number {
			return this.time;
		}
		
		public function setTime(t) {
			this.time = t;
		}
		
		public function toXML():String {
			var str = "<law>";
			str+= "<type>"+AbstractLaw.TYPE+"</type>"
			str += "</law>";
			return str;
		}
				
	}
	
}